<template>
  <div class="home">
    <my-input v-model="title">
      <button @click="add(title)">添加</button>
    </my-input>
    <my-list />
  </div>
</template>

<script>
// @ is an alias to /src
import myHeader from "@/components/myHeader.vue";
import myInput from "@/components/myInput.vue";
import myList from "@/components/myList.vue";
import myMask from "@/components/myMask.vue";
import { mapMutations } from "vuex";

export default {
  data() {
    return {
      title: "",
      show: false,
    };
  },
  name: "HomeView",
  components: {
    myHeader,
    myInput,
    myList,
    myMask,
  },
  methods: {
    ...mapMutations(["add"]),
  },
};
</script>
<style lang="scss" scoped>
.btn {
  li {
    width: 100px;
    height: 50px;
    margin: 20px;
    text-align: center;
    line-height: 50px;
    color: #fff;
  }
}
</style>
